package com.adee.netty.tcp;

import java.nio.charset.StandardCharsets;

// 自定义协议包
public class MessageProtocol {
    public MessageProtocol(byte[] bytes) {
        this.len = bytes.length;
        this.content = bytes;
    }
    private int len;
    private byte[] content;

    public int getLen() {
        return len;
    }

    public void setLen(int len) {
        this.len = len;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "MessageProtocol{" +
                "len=" + len +
                ", content=" + new String(content, StandardCharsets.UTF_8) +
                '}';
    }
}
